/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package OtherPubs;

import Rout.GoBefore;
import org.openqa.selenium.By;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

/**
 *
 * @author user
 */
public class SoftwareInformer  {

 private final GoBefore browser = new GoBefore();
    @BeforeMethod
     void setUp() throws Exception {
        System.out.println("\n Run test: " + getClass().getSimpleName());
        
        
        browser.setRemoteDriver("192.168.4.85");
        browser.setCurURL("http://office-convert-word-txt-to-image-jpg-jpe.software.informer.com/download/");        
        browser.setFilename_exp("SaveAs");
        browser.setRepDir(getClass().getSimpleName());
        
    }        
            
    @Test
    public void ClickOnButton () throws Exception {                
        
        browser.setCssButton("#text-banner > a");
        browser.setClButton("adfiles-recommend");
        browser.setLinkButton("CLICK HERE");
        browser.setXpButton("//*[@id=\"text-banner\"]/a");
        
        
        browser.setUp();
        //say "No" to custom allert
//        Thread.sleep(8000);
//        try {
//            browser.getClicker().click(browser.getDriver().findElement(By.xpath("//*[@id=\"jqi_state0_buttonNo\"]"))).perform();
//            System.out.println("say \"No\" to custom allert");
//            browser.getDriver().switchTo().defaultContent();            
//        } catch (Exception e) {
//            System.out.println("no custom allert");
//        }
        
        browser.refreshCurlURL(2, 2);
        browser.testRun();
        browser.verFilePresent();
    
    }
    
    @AfterMethod
    public void ThearsDown() {
        browser.getDriver().quit();      
        
    }       
    
    
}
